package org.oc.qaq.service;

import org.oc.qaq.config.OnlyOfficeConfig;
import org.oc.qaq.dto.FileDTO;
import org.oc.qaq.dto.FilePageQueryDTO;
import org.oc.qaq.entity.FileEntity;
import org.oc.qaq.exception.UnsupportedFileTypeException;
import org.oc.qaq.result.PageResult;
import org.oc.qaq.result.Result;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

public interface FileService {
    Result<String> upload(MultipartFile file, List<Long> tagIds) throws UnsupportedFileTypeException, IOException;

    ResponseEntity<byte[]> download(String id) throws IOException;

    OnlyOfficeConfig createOrUpdate(FileDTO fileDTO) throws IOException;

    void rename(String newName, String id);

    FileEntity getOneById(String fileId);

    PageResult<?> listFiles(FilePageQueryDTO queryDTO);

    Result<String> delete(String id);

    Result<String> restore(String id);

    void updateFileUrl(String fileName, String ossUrl);

    Result<String> deleteCompletely(String id);

    void changeTag(String fileId, Long tagId);
}
